45f66e441d3dbc289bf5881504590ac38b248b77,choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/CMinMTTR.java,CMinMTTR,postCostConstraints,#,205

Before Change


            rp.getLogger().debug("Post the cost-oriented constraints");
            IntVar[] mttrs = Stream.concat(rp.getVMActions().stream(), rp.getNodeActions().stream())
                    .map(Transition::getEnd)
                    .filter(v -> !v.isInstantiatedTo(0))
                    .toArray(IntVar[]::new);

            rp.getModel().post(rp.getModel().sum(mttrs, "=", cost));
        }

After Change


            costActivated = true;
            rp.getLogger().debug("Post the cost-oriented constraints");
            List<IntVar> mttrs = Stream.concat(rp.getVMActions().stream(), rp.getNodeActions().stream())
                    .map(Transition::getEnd).collect(Collectors.toList());

            //With choco 4.0.1, we cannot post a simple sum() constraint due to hardcore
            //simplification it made. So we bypass the optimisation phase and post the propagator